#!/usr/bin/env bash
# Copyright (c) 2020 The Toltec Contributors
# SPDX-License-Identifier: MIT

pkgnames=(quickjs)
pkgdesc="A small and embeddable Javascript engine"
url=https://bellard.org/quickjs/
pkgver=2024.01.13-1
section="devel"
timestamp=2024-01-13T00:00Z
maintainer="khanhas <xuankhanh963@gmail.com>"
license=MIT

image=base:v3.1
source=(
    https://bellard.org/quickjs/quickjs-2024-01-13.tar.xz
)
sha256sums=(
    3c4bf8f895bfa54beb486c8d1218112771ecfc5ac3be1036851ef41568212e03
)

build() {
    make CROSS_PREFIX="$CROSS_COMPILE" qjs qjscalc
}

package() {
    install -d "$pkgdir"/opt/bin
    install -D -m 755 -t "$pkgdir"/opt/bin/ "$srcdir"/qjs
    ln -s qjs "$pkgdir"/opt/bin/qjscalc
}
